1. Field of the Invention
The present invention relates generally to a method and apparatus for restoring an audio stream, and in particular, to a method and apparatus for storing an Advanced Audio Coding (AAC) stream from an asynchronous audio Packetized Elementary Stream (PES) stream.
2. Description of the Related Art
In satellite Digital Multimedia Broadcasting (DMB), audio data is transmitted in a predetermined transport stream on a broadcast channel which will be described with reference to FIG. 1.
Referring to FIG. 1, an AAC stream 102 is created by compressing and encoding the audio PCM (Pulse Coded Modulation) data of an audio PCM stream 100 in an MPEG-2 (Moving Picture Expert Group-2) AAC+SBR (Spectral Band Replication) CODEC (Coder-Decoder) and attaching a header to the compressed-coded audio data. The PCM stream 100 includes PCM frames each having PCM data in which 2,048 samples of data are sampled at 48 kHz. The AAC stream 102 includes Audio Data Transport Stream (ADTS) frames each having a compressed-coded PCM frame attached with an ADTS header. In FIG. 1, each ADTS header is denoted by ‘A’.
The AAC stream 102 is segmented to a predetermined size in compliance with the ISO (International Organization for Standardization)/IEC (International Organization for Standardization) 13818-1 standard, and a header 112 is attached to each segment stream 114, thereby producing PES packets. These PES packets form a PES stream 104. The PES header 112 of each PES packet is denoted by “P” in FIG. 1.
The PES stream 104 is in turn segmented to a predetermined size and a header 116 is attached to each segment stream 118, thus creating TS (Transport Stream) packets. The TS packets form a TS stream 106.
Referring back to the PES stream 104, t0 through t5 inserted at the start of the PCM frames in the PCM frame 100 are time information values indicating when the audio information is to be represented in a decoder. The time information is included in part of PES header data as time stamps.
In order to deliver as much audio data as possible in TS packets of a fixed size, the conventional satellite DMB service does not synchronize the ADTS headers of the AAC stream to the PES headers of the PES stream. As noted from FIG. 1, the ADTS header “A” does not follow the PES header “P” all the time. This method is called an asynchronous PES scheme, which offers the benefit of transmitting as much audio data as possible in TS packets.
Without processing TS packets including an error, however, the asynchronous PES scheme restores the AAC stream to the form illustrated in FIG. 2 which illustrates an example of restoring a TS stream 200 to a PES stream 202 and then to an AAC stream 204 on the assumption that two TS packets 206 and 208 in the TS stream 200 are corrupted by errors. The PES stream 202 resulting from the TS stream 200 also includes corrupted PES data 210 and 212 corresponding to the TS packets 206 and 208. If the TS stream 200 does not contain any errors, the PES stream 202 can be restored similarly to the PES stream 104 illustrated in FIG. 1. But when the TS steam 200 contains errors such as those included in packets 206 and 208, the restored PES stream includes the corrupted PES data 210 and 212.
Similarly, the AAC stream 204 restored from the PES stream 202 includes corrupted data 214 and 216, unlike the AAC stream 102 illustrated in FIG. 1. The corrupted data 214 and 216 may include data field 218 corresponding to an ADTS header.
As described above, the AAC stream with corrupted data causes problems in an audio CODEC. In addition, if the data field 218 corresponding to size in the ADTS header is corrupted as illustrated in FIG. 2, the audio CODEC may experience a fatal error.
Discard of the corrupted PES data to prevent errors, causes a loss of the time information. As a result, the audio data is reproduced too fast and ADTS data with different headers are mixed in an ADTS frame, seriously affecting the audio CODEC.